home *** CD-ROM | disk | FTP | other *** search
Wrap
//*********************************************************************************** // Required @DefineProject block: @DefineProject @Name = "TransEra HTBasic MakeDisk Utility" @Version = "6.0" @OutDrive = C @Subdir = "\\" @ShowName(1, "Creating TransEra HTBasic Disks", "Times", 2, 20, (@WinScreenCaps(10) - 100), @RGB(0, 0, 255)) @Immediate = @TRUE @EndProject //*********************************************************************************** // Prototypes of Functions: @DefineProto @Void @Center(@In @Int @Row, @In @Int @Color, @In @Qstr @Text) @VOID @PleaseWait(@Void) @VOID @WaitCopying(@Void) @Void @PutWelcomeBanner(@Void) @Void @GetDestDrive(@Void) @Void @GetVersion(@Void) @Void @GetVersionPlus(@Void) @Void @ConfirmPriorToCopy(@Void) @Integer @CheckDisk(@In @Drive @CheckDrive) @Void @AskForFloppy(@In @QString @DiskLabel) @INT @PutYESNO(@IN @QSTR @MSGTitle, @IN @QSTR @Message, @In @QStr @YesText, @In @QStr @NoText) @EndProto //*********************************************************************************** // Variables: @DefineVars // MakeDisk Vars @QString @QuotesDisp = "\"" @Integer @WIN60 = @TRUE @Integer @DOS60 = @FALSE @Integer @DOS44 = @FALSE @QString @OtherVersion = "" @Integer @Button100 = 0 @Integer @Button110 = 0 @Integer @Button120 = 0 @Integer @Button130 = 0 @QString @OtherDrive = "A" @Integer @ProcessCode = 0 @Integer @DOS = 1 @Integer @OS2 = 2 @Integer @WIN = 3 @Integer @SettingsCounter = 0 @EndVars //*********************************************************************************** // @Center function: @DefineFunc @Void @Center(@In @Int @Row, @In @Int @Color, @In @Qstr @Text) @MoveCStr(@Row, ((78 - @StrLen("@Text")) / 2), @Color, "@Text") @Return() @EndFunc // @Center //*********************************************************************************** // @PleaseWait function: @DefineFunc @Void @PleaseWait(@Void) @If (@Platform < 3) @Center(4, 151, "Please wait, processing ...") @EndIf @Return() @EndFunc // @PleaseWait() //*********************************************************************************** // @WaitCopying function: @DefineFunc @Void @WaitCopying(@Void) @If (@Platform < 3) @Center(4, 151, "Please wait, Copying Files ...") @EndIf @Return() @EndFunc // @WaitCopying() //*********************************************************************************** // @PutWelcomeBanner: @DefineFunc @Void @PutWelcomeBanner(@Void) @If(@Platform < @Win) @Display @Cls @EndDisplay // If DOS @Display Welcome to the @Name Program. This program will Create HTBasic Legacy installion diskettes. You will need two 1.44 MB 3.5@QuotesDisp formatted diskettes. If you need to prepare diskettes at this time, press [Esc] to abort, or any other key to continue. @Pause @EndDisplay @ProcessCode = 1 @Else // @Platform Windows @Button110 = 0 @Button120 = 0 @BeginWinDialog("Welcome","TransEra HTBasic MakeDisk Utility") @StaticText(300,"\nWelcome to the @Name Program. This program will Create HTBasic Legacy installion diskettes.\n\n\nTwo 1.44 MB 3.5\" formatted diskettes will be required to complete the MakeDisk Utility.\n\n\nClick Cancel to quit the Utility and then prepare the diskettes. Click Next to continue with the MakeDisk Utility program.") @Button(110, "&Next>") @Button(120, "&Cancel") @Bitmap(200, "Welcome") @ExecuteDialog @Button110 = @Button(110) @Button120 = @Button(120) @Endwindialog @If(@Button110) @ProcessCode = 1 @Else @ProcessCode = 99 @EndIf @EndIf // windows @Return() @EndFunc // PutWelcomeBanner //*********************************************************************************** // @GetDestDrive: @DefineFunc @Void @GetDestDrive(@Void) @If(@Platform < @WIN) WRONGDRIVE: @GetString @OtherDrive @CLS @Prompt = "Enter drive letter (A or B):" Please enter the drive letter for the 3.5@QuotesDisp 1.44 MB floppy drive where you would like to create the HTBasic Installation diskettes. @LocalWindow(9,30) @EndString @If(("@OtherDrive" == "A") || ("@OtherDrive" == "B")) @ProcessCode = 4 @OutDrive = @StrIndex("@OtherDrive",0) @Else @GOTO WRONGDRIVE @EndIf /* @GetOutDrive @OtherDrive @Cls @Center(1, 0b01111001, "Select Output Drive") @LocalWindow(8, 30) Please select the 1.44 MB floppy drive where you would like to create the HTBasic Installation diskettes. Press Esc to Abort. @Suppress(0, 2) // suppress non-removable drives @Suppress(0, 16) // suppress cdrom drives @EndOutDrive */ @Else // windows @GetOutDrive @DlgCtrlSize(0,6,5,9,32) Please select the 1.44 MB floppy drive where you would like to create the HTBasic Installation diskettes. @Suppress(0, 2) // suppress non-removable drives @Suppress(0, 16) // suppress cdrom drives @EndOutDrive @EndIf // Platform @ProcessCode = 4 @Return() @EndFunc // GetDestDrive //*********************************************************************************** // @GetVersion: @DefineFunc @Void @GetVersion(@Void) @If(@Platform < @Win) @ClearOption(100) @ClearOption(120) @ClearOption(121) @ClearOption(122) @GetOption @Cls @Center(1, 0b01111001, "Select Version") @LocalWindow(12,40) Please choose the version of HTBasic for which you would like to Make Installation disks. @Option 100 = "HTBasic for Windows 6.1" @Option 120 = "HTBasic for DOS 6.0" @Option 121 = "Other" @Option 122 = "Abort" @EndOption @If(@OptionIsSet(100)) @WIN60 = @TRUE @DOS60 = @FALSE @DOS44 = @FALSE @ProcessCode = 3 @Return() @ElseIf(@OptionIsSet(120)) @WIN60 = @FALSE @DOS60 = @TRUE @DOS44 = @FALSE @ProcessCode = 3 @Return() @ElseIf(@OptionIsSet(121)) @WIN60 = @FALSE @DOS60 = @FALSE @DOS44 = @FALSE @ProcessCode = 2 @Return() @Else @ProcessCode = 99 @Return() @EndIf @Else // Windows @Button100 = 0 @Button110 = 0 @Button120 = 0 @Button130 = 0 @BeginWinDialog("MAKEDISK", "Select Version") @Button(100, "<&Back") @Button(110, "&Next>") @Button(120, "&Cancel") @Button(200) @Bitmap(200, "Welcome") @RBRange(1000,1001) @RB(1000, "HTBasic for &Windows 6.1", @WIN60) @RB(1001, "HTBasic for &DOS 6.0", @DOS60) @ExecuteDialog @Button100 = @Button(100) @Button110 = @Button(110) @Button120 = @Button(120) @Button130 = @Button(200) @WIN60 = @RB(1000) @DOS60 = @RB(1001) @IF(@WIN60) @DOS60 = @FALSE @DOS44 = @FALSE @Else @WIN60 = @FALSE @DOS44 = @FALSE @EndIf @Endwindialog @If(@Button100) // Back @ProcessCode = 0 @ElseIf(@Button110) // Next @ProcessCode = 3 @ElseIf(@Button130) // Graphic @ProcessCode = 2 @Else // Cancel @ProcessCode = 99 @EndIf @EndIf @Return() @EndFunc // GetVersion //*********************************************************************************** // @GetVersionPlus: @DefineFunc @Void @GetVersionPlus(@Void) @If(@Platform < @Win) @GetString @OtherVersion Please call HTBasic Technical Support for the MakeDisk code to enter below. @LocalWindow(9,30) @Prompt = "Enter MakeDisk Code:" @EndString @If("@OtherVersion" == "44") @WIN60 = @FALSE @DOS60 = @FALSE @DOS44 = @TRUE @ProcessCode = 3 @Else @ProcessCode = 1 @EndIf @Else // Windows @Button100 = 0 @Button110 = 0 @Button120 = 0 @BeginWinDialog("MAKEDISK_PLUS", "Select Version") @Button(100, "<&Back") @Button(110, "&Next>") @Button(120, "&Cancel") @Bitmap(200, "Welcome") @EditBox(410, "") @ExecuteDialog @Button100 = @Button(100) @Button110 = @Button(110) @Button120 = @Button(120) @OtherVersion = "@EditBox(410)" @Endwindialog @If(@Button100) // Back @ProcessCode = 1 @ElseIf(@Button110) // Next @If("@OtherVersion" == "44") @WIN60 = @FALSE @DOS60 = @FALSE @DOS44 = @TRUE @ProcessCode = 3 @Else @ProcessCode = 1 @EndIf @Else // Cancel @ProcessCode = 99 @EndIf @EndIf // Platform @Return() @EndFunc // GetVersionPlus //*********************************************************************************** // @PutYESNO: @DefineFunc @INT @PutYESNO( @IN @QSTR @MSGTitle, @IN @QSTR @Message, @IN @QStr @YesText, @IN @QStr @NoText) @ClearOption(100) @ClearOption(120) @ClearOption(121) @GetOption @Cls @Center(1, 0b01111001, "@MsgTitle") @LocalWindow(14,40) @Message @Option 100 = "@YesText" @If(@StrLen("@NoText") > 0) @Option 120 = "@NoText" @EndIf @Option 121 = "Abort" @EndOption @If(@OptionIsSet(100)) @Return(1) @ElseIf(@OptionIsSet(120)) @Return(0) @Else @Exit @EndIf @Return(0) @EndFunc // PutYESNO //*********************************************************************************** // @ConfirmPriorToCopy @DefineFunc @Void @ConfirmPriorToCopy(@Void) @if(@Platform < @Win) @If(@PutYESNO("Ready To Create Diskettes", "\n\tThe MakeDisk Utility has enough information to start\n\tcreating the install diskettes.\n\n\tIf you want to review or change any settings, select Review.\n\tIf you are satisfied with the settings, Select Copy Files\n\tto begin creating diskettes.", "Copy Files", "Review") !=1) @PROCESSCODE = 1 @Return() @EndIf @ProcessCode = 100 @Else //Windows @SettingsCounter = 303 @Button100 = 0 @Button110 = 0 @Button120 = 0 @BeginWinDialog("CONFIRM_COPY", "Confirm Information Prior to Copy") @Button(100, "<&Back") @Button(110, "&Next>") @Button(120, "&Cancel") @Bitmap(200, "welcome") @StaticText(300, "The MakeDisk Utility has enough information to start creating the install diskettes. If you want to review or change any settings, click Back. If you are satisfied with the settings, click Next to begin creating diskettes.") @StaticText(302, "@Name version:") @If(@WIN60) @StaticText(@SettingsCounter, "TransEra HTBasic for Windows release 6.0") @SettingsCounter = (@SettingsCounter + 1) @EndIf @If(@DOS60) @StaticText(@SettingsCounter, "TransEra HTBasic for DOS release 6.0") @SettingsCounter = (@SettingsCounter + 1) @EndIf @If(@DOS44) @StaticText(@SettingsCounter, "TransEra HTBasic for DOS release 4.4") @SettingsCounter = (@SettingsCounter + 1) @EndIf @StaticText(308, "Target Drive:") @StaticText(309, "@OutDrive:") @StaticText(310, "") @StaticText(311, "") @executeDialog @Button100 = @Button(100) @Button110 = @Button(110) @Button120 = @Button(120) @endwindialog @If(@Button100) @ProcessCode = 1 @ElseIf(@Button110) @ProcessCode = 100 @Else @ProcessCode = 99 @EndIf @EndIf // Platform @Return() @EndFunc // ConfirmPriorToCopy //*********************************************************************************** // @CheckDisk @DefineFunc @Integer @CheckDisk(@In @Drive @CheckDrive) @If((@DiskSize(@CheckDrive) == 0) || // Not inserted (or) (@DiskSize(@CheckDrive) != @DiskFree(@CheckDrive))) // Not blank @PROCESSCODE = 100 @Return(0) @EndIf @If((@DiskSize(@CheckDrive) < 1440000) // Not a 1.44MB drive @Button110 = 0 @Button120 = 0 @BeginWinDialog("ALERT_BOX_TWO_BUTTON","Severe") @StaticText(114,"The drive selected \(@CheckDrive: Drive\) is not a 1.44MB Drive. Please select another drive.") @Button(110, "&OK") @Button(111, "&Cancel") // @Icon(113, "THREEHAL.ICO") @ExecuteDialog @Button110 = @Button(110) @Button120 = @Button(111) @Endwindialog @If(@Button110) @PROCESSCODE = 3 @Return(0) @EndIf @EndIf @Return(1) @EndFunc // CheckDisk //*********************************************************************************** // @AskForFloppy @DefineFunc @Void @AskForFloppy(@In @QString @DiskLabel) @if(@Platform < @Win) @Display @CLS Please place a 3.5@QuotesDisp 1.44MB formatted disk in drive @OutDrive: and label it @QuotesDisp@DiskLabel@QuotesDisp @Pause @EndDisplay @Else // Windows @DiskFree(@OutDrive) @Button100 = 0 @Button110 = 0 @BeginWinDialog("MESSAGE", "Insert Diskette") @Button(100, "&OK") @Button(110, "&Cancel") @StaticText(300, "\nPlease place a blank, 3.5\" 1.44MB formatted disk in drive @OutDrive: and label it \n\n\n \"@DiskLabel\"") @ExecuteDialog @Button100 = @Button(100) @Button110 = @Button(110) @EndWinDialog @If(@Button100) @Return() @Else @Abort @EndIf @EndIf // Platform @Return() @EndFunc // AskForFloppy //*********************************************************************************** // Main Script @PleaseWait() //*********************************************************************************** // PROCESSLOOP: PROCESSLOOP: @If(@PROCESSCODE == 0) @PutWelcomeBanner() @PleaseWait() @ElseIf(@PROCESSCODE == 1) @GetVersion() @PleaseWait() @ElseIf(@PROCESSCODE == 2) @GetVersionPlus() @PleaseWait() @ElseIf(@PROCESSCODE == 3) @GetDestDrive() @PleaseWait() @ElseIf(@PROCESSCODE == 4) @ConfirmPriorToCopy() @PleaseWait() @ElseIf(@PROCESSCODE == 99) @Abort @EndIf @If(@ProcessCode < 100) @GOTO PROCESSLOOP @EndIf // end-of-PROCESSLOOP: @SetCursor("HOURGLASS") @If(@DOS60) @AskForFloppy("HTBasic for DOS Disk 1") @If(!@CheckDisk(@OutDrive)) @GOTO PROCESSLOOP @EndIf @ShowBmp(0,60,30,"copy.bmp",2) @WaitCopying() @Copy("floppy\\60dos\\disk1\\disk.id", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk1\\install.dat", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk1\\funcs.dat", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk1\\events.dat", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk1\\uifuncs.dat", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk1\\install.exe", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk1\\cpx.red", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk1\\drivers.red", "@OutDrive:\\*.*") @EraseBmp(0) AGAIN_DOS60: @AskForFloppy("HTBasic for DOS Disk 2") @If(!@CheckDisk(@OutDrive)) @GOTO AGAIN_DOS60 @EndIf @ShowBmp(0,60,30,"copy.bmp",2) @WaitCopying() @Copy("floppy\\60dos\\disk2\\disk.id", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk2\\install.dat", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk2\\lexical.red", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk2\\nocpx.red", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk2\\progdrv.red", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk2\\htscope.red", "@OutDrive:\\*.*") @Copy("floppy\\60dos\\disk2\\example.red", "@OutDrive:\\*.*") @EraseBmp(0) @ElseIf(@WIN60) @AskForFloppy("HTBasic for Windows Disk 1") @If(!@CheckDisk(@OutDrive)) @GOTO PROCESSLOOP @EndIf @ShowBmp(0,60,30,"copy.bmp",2) @WaitCopying() @Copy("floppy\\61win\\disk1\\*.*", "@OutDrive:\\*.*") @EraseBmp(0) AGAIN_D2_WIN60: @AskForFloppy("HTBasic for Windows Disk 2") @If(!@CheckDisk(@OutDrive)) @GOTO AGAIN_D2_WIN60 @EndIf @ShowBmp(0,60,30,"copy.bmp",2) @WaitCopying() @Copy("floppy\\61win\\disk2\\*.*", "@OutDrive:\\*.*") @EraseBmp(0) AGAIN_D3_WIN60: @AskForFloppy("HTBasic for Windows Disk 3") @If(!@CheckDisk(@OutDrive)) @GOTO AGAIN_D3_WIN60 @EndIf @ShowBmp(0,60,30,"copy.bmp",2) @WaitCopying() @Copy("floppy\\61win\\disk3\\*.*", "@OutDrive:\\*.*") @EraseBmp(0) @ElseIf(@DOS44) @AskForFloppy("HTBasic for DOS 4.4 Disk 1") @If(!@CheckDisk(@OutDrive)) @GOTO PROCESSLOOP @EndIf @ShowBmp(0,60,30,"copy.bmp",2) @WaitCopying() @Copy("floppy\\44dos\\disk1\\*.*", "@OutDrive:\\*.*") @EraseBmp(0) AGAIN_D2_DOS44: @AskForFloppy("HTBasic for DOS 4.4 Disk 2") @If(!@CheckDisk(@OutDrive)) @GOTO AGAIN_D2_DOS44 @EndIf @ShowBmp(0,60,30,"copy.bmp",2) @WaitCopying() @Copy("floppy\\44dos\\disk2\\*.*", "@OutDrive:\\*.*") @EraseBmp(0) @EndIf @SetCursor("ARROW") //******************************************************************************************* @If(@Platform < @Win) @Display @Cls The diskette creation was successfully completed. @Pause @Exit @EndDisplay @Else // If Windows @Button100 = 0 @Button110 = 0 @BeginWinDialog("FINISH_WINDOWS","Installation Complete") @Button(110, "&OK") @EditBox(300, "@OutDrive:\\@Subdir") @executeDialog @Button110 = @Button(110) @endwindialog @Exit @EndIf // INIChanged @EndIf // Platform // end-of-file